package day7;

import day3.School;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;

/**
 * @author oldliu
 * @since 1.0
 */
public class ReadObject {
    public static void main(String[] args) {
        //反序列化:从流中恢复对象
        try {
            ObjectInputStream oin=new ObjectInputStream(new FileInputStream("f:/java82/school.obj"));
            School  s = (School)oin.readObject();
            oin.close();
            System.out.println(s);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
